Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/14941 whitespace above block quotes is stripped away #15504

Conversation

tienifr
Copy link
Contributor

@tienifr tienifr commented Feb 27, 2023

Details

When we intentionally add a blank line above the blockquote and send it, there's no blank line above the block quote. In order to fix this issue, we should remove that replacement logic in expensify-common repo and enable the enableExperimentalBRCollapsing flag of react-native-render-html on native platform so that the behavior of the native platform will follow the correct HTML standard.

Fixed Issues

$ #14941
PROPOSAL: #14941 (comment)

Tests

For all platforms

1, Compose a message like this:

normal text

> quote text

normal text

2, Post the message
3, Edit the message you posted
4, Verify that there is a blank line (and an even amount of space) above and below the block quote. The same message you sent in step 1 is shown in the editor

Additional test for IOS and Android (to ensure there is no regression bug created by the PR)

1, Compose a message like this:

normal text
> quote text
normal text

2, Post the message
3, Verify that there is no extra space displayed when used non-quoted and quoted than non-quoted text

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

For all platforms

1, Compose a message like this:

normal text

> quote text

normal text

2, Post the message
3, Edit the message you posted
4, Verify that there is a blank line (and an even amount of space) above and below the block quote. The same message you sent in step 1 is shown in the editor

Additional test for IOS and Android (to ensure there is no regression bug created by the PR)

1, Compose a message like this:

normal text
> quote text
normal text

2, Post the message
3, Verify that there is no extra space displayed when used non-quoted and quoted than non-quoted text

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
web.mp4
Mobile Web - Chrome
chrome.mp4
Mobile Web - Safari
safari.mp4
Desktop
desktop.mp4
iOS
ios.2.mp4
Android
android.1.mp4

@tienifr tienifr changed the title fix: update version of expensify-common repo Fix/14941 whitespace above block quotes is stripped away Feb 27, 2023
@tienifr tienifr marked this pull request as ready for review February 27, 2023 05:15
@tienifr tienifr requested a review from a team as a code owner February 27, 2023 05:15
@melvin-bot melvin-bot bot requested review from rushatgabhane and thienlnam and removed request for a team February 27, 2023 05:15
@MelvinBot
Copy link

@thienlnam @rushatgabhane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@tienifr
Copy link
Contributor Author

tienifr commented Mar 1, 2023

Hi, @rushatgabhane Could you help to review this PR? This PR is created 2 days ago

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 1, 2023

@tienifr the version is supposed to be upgraded by someone internal only.

https://github.com/Expensify/expensify-common#deploying-a-change-expensify-only

@rushatgabhane
Copy link
Member

@thienlnam since @tienifr has already upgraded App, could you please upgrade the version for other repos. https://github.com/Expensify/expensify-common#deploying-a-change-expensify-only

@thienlnam
Copy link
Contributor

Did someone not create a new version when the expensify-common PR was merged?

@rushatgabhane
Copy link
Member

@thienlnam i don't think so.

Main is at commit 69e32de

image

@thienlnam
Copy link
Contributor

thienlnam commented Mar 1, 2023

Actually, this should be fine I'm not sure what the problem is - the App changes are now pointing the latest expensify-common

We don't need to update the other repos unless there was changes merged that need to be updated, and looking at the changes from https://github.com/Expensify/expensify-common/pull/503/files it shouldn't impact any other repo

So this should be ready to be reviewed right?

I think the expensify only page needs to be updated since contributors can create App PRs with the new commit hash

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 2, 2023

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web image
Mobile Web - Chrome image
Mobile Web - Safari image
Desktop image
iOS image
Android

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thienlnam LGTM!

@thienlnam thienlnam merged commit 7190ca2 into Expensify:main Mar 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Performance Comparison Report 📊

Significant Changes To Duration

Name Duration
Open Search Page TTI 587.189 ms → 697.497 ms (+110.308 ms, +18.8%) 🔴
Show details
Name Duration
Open Search Page TTI Baseline
Mean: 587.189 ms
Stdev: 23.602 ms (4.0%)
Runs: 544.1769210007042 549.3025310002267 561.3677159994841 563.6081130001694 564.8183189993724 566.415811999701 568.028809000738 570.7482510004193 571.9572350000963 574.5061039999127 575.3924559997395 578.0389000000432 578.3668629992753 578.7380380006507 579.4772140001878 579.5346269998699 581.2865399997681 582.535074999556 584.2497149994597 585.9375010002404 594.7528889998794 595.8427330004051 597.4546309998259 600.1714679999277 602.1302089998499 602.1517740003765 609.2001550002024 622.099771999754 622.6467700004578 627.1015629991889 635.5471189999953 642.4485280001536

Current
Mean: 697.497 ms
Stdev: 23.011 ms (3.3%)
Runs: 641.7950440002605 650.4772539995611 659.046996999532 669.7556569995359 675.5036620004103 682.7564300000668 684.8427329994738 685.1317549999803 686.2432859996334 689.1704510003328 690.4206950003281 693.0718189999461 693.1122239995748 698.5983890006319 703.2902029994875 704.4873860003427 705.7103269994259 705.7720540007576 707.6934819994494 708.746907999739 709.687663000077 714.2716070003808 714.9345709998161 715.397135999985 716.7574060000479 718.5622969996184 726.7820230005309 731.1154789999127 744.2730710003525

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 751.273 ms → 777.126 ms (+25.853 ms, +3.4%)
App start runJsBundle 209.656 ms → 213.097 ms (+3.441 ms, +1.6%)
App start nativeLaunch 19.667 ms → 20.194 ms (+0.527 ms, +2.7%)
App start regularAppStart 0.015 ms → 0.017 ms (+0.001 ms, +7.9%)
Show details
Name Duration
App start TTI Baseline
Mean: 751.273 ms
Stdev: 39.382 ms (5.2%)
Runs: 650.1555329998955 695.7304959995672 703.540200999938 706.8430770002306 714.321053000167 715.3216369999573 723.9003839995712 724.278715999797 724.4751709997654 725.615499000065 726.6817420003936 729.6514459997416 735.1403120001778 735.2270280001685 741.8509700000286 749.7708170004189 752.4694849997759 754.6928449999541 755.9779930002987 765.0178070003167 766.4596229996532 769.4411850003526 771.4475410003215 775.9970249999315 789.2342229997739 790.1923230001703 791.1046639997512 798.0859009996057 804.0031190002337 806.9677980002016 823.4363609999418 823.7089189998806

Current
Mean: 777.126 ms
Stdev: 24.985 ms (3.2%)
Runs: 723.9879830004647 743.575264999643 744.9614030001685 745.8489690003917 749.5649809995666 750.412595000118 753.79880400002 757.5919960001484 762.266127999872 766.91878800001 767.8494359999895 767.875 771.0933290002868 771.5869749998674 774.3215870000422 774.3964759996161 774.8808880001307 776.9665919998661 777.1341380001977 777.9535229997709 780.0998839996755 785.5078750001267 789.7056430000812 789.9880449995399 793.6961759999394 796.6852869996801 801.2477230001241 813.301191999577 814.7709489995614 814.9998629996553 818.9225230002776 836.1321139996871
App start runJsBundle Baseline
Mean: 209.656 ms
Stdev: 21.520 ms (10.3%)
Runs: 163 181 185 185 188 190 193 194 196 196 199 199 200 203 206 206 206 207 209 210 218 222 223 225 227 227 228 229 239 239 251 265

Current
Mean: 213.097 ms
Stdev: 12.736 ms (6.0%)
Runs: 193 196 198 199 201 202 203 203 204 205 205 205 206 208 208 213 214 214 215 215 215 217 221 223 224 227 228 230 232 233 249
App start nativeLaunch Baseline
Mean: 19.667 ms
Stdev: 1.513 ms (7.7%)
Runs: 17 17 18 18 18 18 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 21 21 21 22 22 23 23

Current
Mean: 20.194 ms
Stdev: 1.512 ms (7.5%)
Runs: 18 18 18 18 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 21 21 21 21 22 22 22 22 22 23 24
App start regularAppStart Baseline
Mean: 0.015 ms
Stdev: 0.001 ms (7.0%)
Runs: 0.012858000583946705 0.013427999801933765 0.01355000026524067 0.013712000101804733 0.014077999629080296 0.0147299999371171 0.014851999469101429 0.014852000400424004 0.014973999932408333 0.01501499954611063 0.015096000395715237 0.015096000395715237 0.015258999541401863 0.015298999845981598 0.015341000631451607 0.015381000004708767 0.015543999150395393 0.01566499937325716 0.015665999613702297 0.015991000458598137 0.016032000072300434 0.016112999990582466 0.016195000149309635 0.01643799990415573 0.016479000449180603 0.01664199959486723 0.016642000526189804 0.016642000526189804 0.0167239997535944 0.016764999367296696 0.017415999434888363

Current
Mean: 0.017 ms
Stdev: 0.001 ms (6.3%)
Runs: 0.014527000486850739 0.0152580002322793 0.015422000549733639 0.015502999536693096 0.01550300046801567 0.01558500062674284 0.015625 0.015665999613702297 0.015747000463306904 0.0157880000770092 0.015868999995291233 0.01631700061261654 0.0163569999858737 0.0165200000628829 0.016560000367462635 0.016560999676585197 0.01664199959486723 0.01680499967187643 0.016927000135183334 0.01696799974888563 0.017211999744176865 0.01733400020748377 0.017374999821186066 0.01749700028449297 0.017659000121057034 0.01769999973475933 0.017904000356793404 0.017904000356793404 0.018025999888777733 0.018352000042796135 0.019082999788224697

@github-actions github-actions bot added the DeployBlockerCash This issue or pull request should block deployment label Mar 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker.

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2023

🚀 Deployed to staging by https://github.com/thienlnam in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Mar 6, 2023

🚀 Deployed to production by https://github.com/mountiny in version: 1.2.78-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeployBlockerCash This issue or pull request should block deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants